package com.caltco.cargo.ops.modules.sys.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.caltco.cargo.ops.common.base.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;

@Data
@TableName("comments")
@Schema(description = "评论")
public class Comments extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.ASSIGN_ID)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @Schema(description = "用户Id")
    private Long id;

    @Schema(description = "用户id")
    @TableField("user_id")
    @JsonProperty("userId")
    private Long userId;

    @Schema(description = "任务id")
    @TableField("task_id")
    @JsonProperty("taskId")
    private Long taskId;

    @Schema(description = "评论内容")
    @TableField("comment")
    @JsonProperty("comment")
    private String comment;

    @Schema(description = "直接父级id")
    @TableField("parent_id")
    @JsonProperty("parentId")
    private Long parentId;


    @Schema(description = "顶级评论id")
    @TableField("root_comment_id")
    @JsonProperty("rootCommentId")
    private Long rootCommentId;


    @Schema(description = "回复详情")
    @TableField("reply_comment")
    @JsonProperty("replyComment")
    private String replyComment;


    @Schema(description = "业务状态")
    @TableField("status")
    @JsonProperty("status")
    private Integer status;

    @Schema(description = "图片")
    @TableField("image_urls")
    @JsonProperty("imageUrls")
    private String imageUrls;


    @Schema(description = "是否删除")
    @TableField("is_delete")
    @JsonProperty("isDelete")
    @TableLogic(value = "0", delval = "1")
    private Integer isDelete;
}
